import request from '@/utils/request/index.js'

export default {
  submitOrder(data) {
    return request({
      url: '/store/mini/order/submit',
      method: 'POST',
      data
    })
  },
  getSettlePriceInfo(data) {
    return request({
      url: '/store/mini/order/getSettlePriceInfo',
      method: 'POST',
      data
    })
  },
  getGoodsTotalCount(data) {
    return request({
      url: '/store/mini/shoppingCart/getGoodsTotalCount',
      method: 'POST',
      data
    })
  },
  testWxOrderPay(data) { // 测试环境支付
    return request({
      url: '/store/mini/order/testWxOrderPay',
      method: 'POST',
      data
    })
  },
  payTrade(data) { // 支付接口
    return request({
      url: '/store/mini/trade/pay',
      method: 'POST',
      data
    })
  },
  queryPayStatus(data) { // 查询支付状态接口
    return request({
      url: '/store/mini/trade/queryPayStatus',
      method: 'GET',
      data
    })
  },
  getFreightPlice(data){ // 运费计算
    return request({
      url: '/store/mini/freightTemplate/getFreight',
      method: 'POST',
      data
    })
  },
  myBuyOrderListDetails(data) { // 查询订单详情
    return request({
      url: '/store/mini/order/myBuyOrderListDetails',
      method: 'GET',
      data
    })
  },

  myBuyOrderList(data) { // 我购买的订单列表
    return request({
      url: '/store/mini/order/myBuyOrderList',
      method: 'POST',
      data
    })
  },
  // 买家确认收货
  myConfirmReceiving(data) {
    return request({
      url: '/store/mini/order/confirmReceiving',
      method: 'POST',
      data
    })
  },
  // 买家取消订单
  myCancelorder(data) {
    return request({
      url: '/store/mini/order/cancelOrder',
      method: 'POST',
      data
    })
  },
  // 查询物流详情
  getLogistics(data) {
    return request({
      url: '/store/mini/order/getLogistics',
      method: 'GET',
      data
    })
  },
  // 获取快递公司列表
  getLogisticsOption(){
    return request({
      url: '/store/common/logistics/com/option',
      method: 'GET'
    })
  },
  
  // 获取卖家订单列表
  sellerBuyOrderList(data) {
    return request({
      url: '/store/mini/order/sellerBuyOrderList',
      method: 'POST',
      data
    })
  },
  // 卖家订单详情
  sellerBuyOrderListDetails(data) {
    return request({
      url: '/store/mini/order/sellerBuyOrderListDetails',
      method: 'GET',
      data
    })
  },
  // 发货
  deliverGoods(data){
    return request({
      url: '/store/mini/order/deliverGoods',
      method: 'POST',
      data
    })
  },
  // 修改物流信息
  updateLogisticsInfo(data){
    return request({
      url: '/store/mini/order/updateLogisticsInfo',
      method: 'POST',
      data
    })
  },
  
  // 通过物流单号识别物流公司
  logisticsAutoNumber(data){
    return request({
      url: '/store/common/logistics/autoNumber',
      method: 'GET',
      data
    })
  },
  // 买家申请售后
  addOrderAfterSales(data){
    return request({
      url: '/store/mini/orderAfterSales/addOrderAfterSales',
      method: 'POST',
      data
    })
  },
  
  // 买家查询售后列表
  myGetUserOrderAfterSales(data){
    return request({
      url: '/store/mini/orderAfterSales/getUserOrderAfterSales',
      method: 'GET',
      data
    })
  },

  // 买家查询售后详情
  myGetAfterDetails(data){
    return request({
      url: '/store/mini/orderAfterSales/getUserOrderAfterSalesDetailsByOrderAfterSalesId',
      method: 'GET',
      data
    })
  },
  // 买家撤销售后
  revocationOrderAfterSales(data){
    return request({
      url: '/store/mini/orderAfterSales/revocationOrderAfterSales',
      method: 'GET',
      data
    })
  },
 
  // 卖家查询售后列表
  sellerGetUserOrderAfterSales(data){
    return request({
      url: '/store/mini/orderAfterSales/getSellerOrderAfterSales',
      method: 'POST',
      data
    })
  },
  // 卖家查询售后详情
  sellerGetAfterDetails(data){
    return request({
      url: '/store/mini/orderAfterSales/getSellerOrderAfterSalesDetailsByOrderAfterSalesId',
      method: 'GET',
      data
    })
  },
  // 售后审核
  auditOrderAfterSales(data){
    return request({
      url: '/store/mini/orderAfterSales/auditOrderAfterSales',
      method: 'POST',
      data
    },{isTransformResult: true})
  },
  // 售后-填写收货地址
  addSellerAdders(data){
    return request({
      url: '/store/mini/orderAfterSales/addSellerAdders',
      method: 'GET',
      data
    })
  },
  // 查询物流，通过快递单号查询
  queryLogistics(data){
    return request({
      url: '/store/common/logistics/query',
      method: 'GET',
      data
    })
  },
  // 卖家-供货修改买家地址
  updateReceiveInfo(data){
    return request({
      url: '/store/mini/order/updateReceiveInfo',
      method: 'POST',
      data
    })
  },
  // 复制售后单
  copyAfterSale(data){
    return request({
      url: '/store/mini/orderAfterSales/copyAfterSale',
      method: 'GET',
      data
    })
  },
  // 买家填写退货单号
  addUserCourierNumber(data){
    return request({
      url: '/store/mini/orderAfterSales/addUserCourierNumber',
      method: 'POST',
      data
    })
  },
  // 买家修改退货物流单号
  updateUserCourierNumber(data){
    return request({
      url: '/store/mini/orderAfterSales/updateUserCourierNumber',
      method: 'POST',
      data
    })
  },
  // 查询团购列表-用于查询订单列表
  getDynamicListForOrder(data){
    return request({
      url: '/store/mini/dynamic/getDynamicListForOrder',
      method: 'POST',
      data
    })
  },
  // 充值退款金额
  tradeRecharge(data){
    return request({
      url: '/store/mini/trade/recharge',
      method: 'POST',
      data
    })
  }
}